{% extends "base.html" %}
{% load staticfiles %}
{% block title %}首页——自学资源平台{% endblock %}
{% block custom_bread %}
   
{% endblock  %}
{% block content %}
<div class="banner">
        <div class="wp">
            <div class="fl">
                <div class="imgslide">
                    <ul class="imgs">
                        {% for row in all_banner %}
                        <li>
                                <a href="{{row.url}}">
                                    <img width="1200" height="478" src="{{MEDIA_URL}}{{row.image}}" />
                                </a>
                            </li>
                        {% endfor %}
                        
                        

                    </ul>
                </div>
                <div class="unslider-arrow prev"></div>
                <div class="unslider-arrow next"></div>
            </div>

            </div>


        </div>
<!--banner end-->
<!--feature start-->
<section>
    <div class="wp">
        <ul class="feature">
            <li class="feature1">
                <img class="pic" src="/static/images/feature1.png"/>
                <p class="center">框架稳定</p>
            </li>
            <li class="feature2">
                <img class="pic" src="/static/images/feature2.png"/>
                <p class="center">性价比高</p>
            </li>
            <li class="feature3">
                <img class="pic" src="/static/images/feature3.png"/>
                <p class="center">开发熟练</p>
            </li>
            <li class="feature4">
                <img class="pic" src="/static/images/feature4.png"/>
                <p class="center">数据真实</p>
            </li>
        </ul>
    </div>
</section>
<!--feature end-->
<!--module1 start-->
<section>
    <div class="module">
        <div class="wp">
            <h1>公开课程</h1>
            <div class="module1 eachmod">
                <div class="module1_1 left">
                    <img width="228" height="614" src="/static/images/module1_1.jpg"/>
                    <p class="fisrt_word">广告位<br/>招租</p>
                    <a class="more" href="{% url 'course:course_list' %}">查看更多课程 ></a>
                </div>
                <div class="right group_list">
                    <div class="module1_2 box">
                        <div class="imgslide2">
                            <ul class="imgs">
                                {% for row in banner_course %}
                                <li>
                                    <a href="{% url 'course:course_detail' row.id %}">
                                        <img width="470" height="300" src="{{MEDIA_URL}}{{row.image}}" />
                                    </a>
                                </li>
                                {% endfor %}
                                
                                
                            </ul>
                        </div>
                        <div class="unslider-arrow2 prev"></div>
                        <div class="unslider-arrow2 next"></div>
                    </div>
                        {% for row in course %}
                        <!--在每个``  for ``循环里有一个称为`` forloop`` 的模板变量,forloop.counter表示从1开始计数-->
                        <div class="module1_{{forloop.counter|add:2}} box">
                            <a href="{% url 'course:course_detail' row.id %}">
                                <img width="233" height="190" src="{{MEDIA_URL}}{{row.image}}"/>
                            </a>
                            <div class="des">
                                <a href="{% url 'course:course_detail' row.id %}">
                                    <h2 title="{{row.name}}">{{row.name}}</h2>
                                </a>
                                <span class="fl">难度：<i class="key">{{row.get_degree_display}}</i></span>
                                <span class="fr">学习人数：{{row.students}}</span>
                            </div>
                            <div class="bottom">
                                <span class="fl" title="{{row.course_org.name}}">{{row.course_org.name}}</span>
                                <span class="star fr">{{row.fav_nums}}</span>
                            </div>
                        </div>
                        {% endfor %}
                        
                </div>
            </div>
        </div>
    </div>
</section>
<section>
    <div class="module greybg">
        <div class="wp">
            <h1>课程机构</h1>
            <div class="module3 eachmod">
                <div class="module3_1 left">
                    <img width="228" height="463" src="/static/images/module3_1.jpg"/>
                    <p class="fisrt_word">名校来袭<br/>权威认证</p>
                    <a class="more" href="{% url 'org:org_list' %}">查看更多机构 ></a>
                </div>
                <div class="right">
                    <ul>
                        {% for row in all_org %}
                            <li {% if forloop.counter|divisibleby:'5' %}class="five"{% endif %}>
                                <a href="{% url 'org:org_home' row.id %}">
                                    <div class="company">
                                        <img width="184" height="100" src="{{MEDIA_URL}}{{row.image}}"/>
                                        <div class="score">
                                            <div class="circle">
                                                <h2>了解更多</h2>
                                            </div>
                                        </div>
                                    </div>
                                    <p><span class="key" title="{{row.name}}">{{row.name}}</span></p>
                                </a>
                            </li>
                        {% endfor %}
                            
                        
                    </ul>
                </div>
            </div>
        </div>
    </div>
</section>
{% endblock %}
{% block custom_js %}
<script type="text/javascript" src="/static/js/index.js"></script>
{% endblock %}
